bond_info_map = {
    'cur_index': '集思录可转债等权指数',
    'amount': '剩余规模',
    'volume': '成交额',
    'count': '转债个数',
    'last_time': '更新时间',
    'cur_increase_val': '涨跌值', 'cur_increase_rt': '涨幅',
    'avg_price': '平均价格', 'avg_premium_rt': '平均溢价率', 'avg_ytm_rt': '平均到期收益率',
    'mid_price': '价格中位数', 'mid_premium_rt': '溢价率中位数', 'mid_convert_value': '转股价值中位数',
    'turnover_rt': '换手率',
    'price_90': '<90价格', 'increase_rt_90': '<90涨幅',
    'price_90_100': '90-100价格', 'increase_rt_90_100': '90-100涨幅',
    'price_100_110': '100-110价格', 'increase_rt_100_110': '100-110涨幅',
    'price_110_120': '110-120价格', 'increase_rt_110_120': '110-120涨幅',
    'price_120_130': '120-130价格', 'increase_rt_120_130': '120-130涨幅',
    'price_130': '>=130价格', 'increase_rt_130': '>=130涨幅'
}

dead_bond_map = {
    "bond_id": "转债代码",
    "bond_nm": "转债名称",
    "price": "最后交易价格",
    "stock_id": "正股代码",
    "stock_nm": "正股名称",
    "orig_iss_amt": "发行规模",
    "put_iss_amt": "回售规模",
    "curr_iss_amt": "剩余规模",
    "issue_dt": "发行日期",
    "redeem_dt": "强赎日期",
    "delist_dt": "最后交易日",
    "maturity_dt": "到期日期",
    "listed_years": "存续年限",
    "delist_notes": "退市原因",
    "max_price": "最高收盘价",
    "max_dt": "最高收盘价日期",
    "min_price": "最低收盘价",
    "min_dt": "最低收盘价日期",
    "first_price": "上市当日收盘价",
    "first_dt": "上市日期",
}
alive_bond_map = {
    "bond_id": "转债代码",
    "bond_nm": "转债名称",
    "bond_py": "转债拼音",
    "price": "现价",
    "increase_rt": "涨跌幅",
    "stock_id": "正股代码",
    "stock_nm": "正股名称",
    "stock_py": "正股拼音",
    "sprice": "正股价",
    "sincrease_rt": "正股涨跌",
    "pb": "正股PB",
    "pe": "正股PE",
    "bond_stdevry": "转债年化波动率",
    "bond_bias20": "转债20日BIAS",
    "stock_bias20": "正股20日BIAS",
    "roe": "正股roe",
    "list_dt": "发行日期",
    "margin_flg": "融资融券标的",
    "pct_rpt": "十大持有人占比",
    "redeem_price_total": "到期赎回价",
    "redeem_status": "强赎状态",
    "dividend_rate": "正股股息率",
    "pe_temperature": "正股PE温度",
    "pb_temperature": "正股PB温度",
    "int_debt_rate": "有息负债率",
    "pledge_rt": "股票质押率",
    "market_value": "正股流通市值",
    "total_market_value": "正股总市值",
    "province": "地域",
    "revenue": "2020年营收",
    "revenue_growth": "营收同比增长",
    "profit": "2020年净利",
    "profit_growth": "利润同比增长",
    "sw_nm_r": "行业",
    "convert_price": "转股价",
    "convert_value": "转股价值",
    "convert_dt": "距离转股日",
    "premium_rt": "溢价率",
    "dblow": "双低",
    "adjust_condition": "下修条件",
    "sw_cd": "行业代码",
    "market_cd": "交易市场",
    "btype": "是否为EB",  # E=是 C=否
    "qflag2": "合格投资者可买",  # Q Q2
    "pb_flag": "股东权益含优先股和永续债,PB值与其他平台存在计算差异",
    "adj_cnt": "转股价下修次数",
    "adj_scnt": "转股价下修成功次数",
    "convert_price_valid": "是否可以转股",
    "owned": "owned",
    "hold": "hold",
    "bond_value": "纯债价值",
    "rating_cd": "评级",
    "option_value": "option_value",
    "volatility_rate": "正股波动率",
    "sturnover_rt":"正股换手率",
    "put_convert_price": "回售触发价",
    "force_redeem_price": "强赎触发价",
    "convert_amt_ratio": "转债流通市值占比",
    "fund_rt": "基金持仓",
    "short_maturity_dt": "到期时间",
    "maturity_dt":"到期时间",
    "year_left": "剩余年限",
    "curr_iss_amt": "剩余规模",
    "volume": "成交额",
    "svolume": "正股成交额",
    "turnover_rt": "换手率",
    "ytm_rt": "到期税前收益",
    "put_ytm_rt": "put_ytm_rt",
    "notes": "notes",
    "noted": "noted",
    "bond_nm_tip": "强赎状态tips",
    "redeem_icon": "强赎图标",  # B=以满足强赎条件 G =暂不强赎  空=条件不满足
    "last_time": "last_time",
    "qstatus": "qstatus",
    "sqflag": "sqflag",
    "convert_price_tips": "转股下修提示",
    "convert_cd_tip":"转股日期提示",
    "ref_yield_info": "ref_yield_info",
    "adjusted": "是否正在下修",
    "orig_iss_amt": "发行规模",
    "price_tips": "price_tips",
    "redeem_dt": "redeem_dt",
    "real_force_redeem_price": "强赎价格",
    "option_tip": "option_tip",
    "last_5d_rt": "近5日涨跌幅",
    "last_20d_rt": "近20日涨跌幅",
    "last_3m_rt": "近3月涨跌幅",
    "last_1y_rt": "近1年涨跌幅",
    "slast_5d_rt": "正股5日涨跌幅",
    "slast_20d_rt": "正股20日涨跌幅",
    "slast_3m_rt": "正股3月涨跌幅",
    "slast_1y_rt": "正股1年涨跌幅",
    "bond_premium_rt": "债底溢价率",
    "convert_amt_ratio2": "转债总市值占比",
    "ytm_rt_tax": "到期税后收益",
    "bond_md":"转债税前修正久期",
    "float_iss_amt":"转债流通规模",
    "float_iss_value":"转债流通市值",
    "total_cash_value":"剩余本息",
    "redeem_dt": "强赎日期",
    "adjust_status":"下修状态",#None S 下修成功 R 提议下修
    "unadj_cnt":"不下修次数",
    "adjust_remain_days":"下修还需几天",
    "redeem_remain_days": "强赎还需几天",
    "after_next_put_dt":"是否处于回售期", # 1是 0否
    "icons":"强赎状态",#{"R"，强赎} {“G”,不提前赎回} {'O'，公告强赎} B=以满足强赎条件 G =暂不强赎  空列表=条件不满足 M=条件不满足
    "last_6m_rt":"近6月涨跌幅",
    "this_y_rt":"转债今年涨跌幅",
    "slast_6m_rt":"正股近6月涨跌幅",
    "sthis_y_rt":"正股今年涨跌幅",
    "debt_rate":"资产负债率",
    "amt_chg":"昨日转股"
}
redeem_columns_map = {
    "bond_id": "转债代码",
    "bond_nm": "转债名称",
    "bond_py": "转债拼音",
    "stock_id": "正股代码",
    "stock_nm": "正股名称",
    "stock_py": "正股拼音",
    "price": "现价",
    "qflag2": "合格投资者可买",  # Q Q2
    "btype": "是否为EB",  # E=是 C=否
    "margin_flg": "融资融券标的",
    "orig_iss_amt": "发行规模",
    "curr_iss_amt": "剩余规模",
    "convert_dt": "距离转股日",
    "convert_price": "转股价",
    "next_put_dt":"回售起始日",
    "redeem_dt":"强赎日期",
    "redeem_price":"到期赎回价",
    "redeem_price_ratio":"强赎触发百分比",
    "redeem_status": "强赎状态",# 页面中显示的状态
    "force_redeem_price": "强赎触发价",
    "redeem_icon": "强赎图标",  # B=以满足强赎条件 G =暂不强赎  O=公告强赎
    "delist_dt": "最后交易日",
    "maturity_dt": "到期日期",
    "year_left": "剩余年限",
    "real_force_redeem_price": "强赎价格",
    "redeem_remain_days": "强赎还需几天",
    "redeem_tc": "强赎条件",
    "recount_dt": "强赎重计数日期",
    "sprice": "正股价格",
    "last_convert_dt": "最后转股日期",
    "after_next_put_dt": "是否处于回售期",  # 1是 0否

}
adjust_columns_map = {
    "bond_id": "转债代码",
    "bond_nm": "转债名称",
    "bond_py": "转债拼音",
    "stock_id": "正股代码",
    "stock_nm": "正股名称",
    "stock_py": "正股拼音",
    "price": "现价",
    "qflag2": "合格投资者可买",  # Q Q2
    "btype": "是否为EB",  # E=是 C=否
    "curr_iss_amt": "剩余规模",
    "convert_price": "转股价",
    "ssc_dt": "开始暂停转股日期",
    "esc_dt": "结束暂停转股日期",
    "sc_notes": "暂停转股日志",
    "adjust_price_ratio": "下修触发价格百分比",
    "sprice": "正股价",
    "lt_bps": "能否低于净值",
    "premium_rt": "溢价率",
    "convert_value": "转股价值",
    "convert_dt": "距离转股日",
    "adjust_count_days": "要求计数天数",
    "adjust_remain_days": "至少还需几天",
    # 1-max:是正常计数天数
    # 0:代表已满足下修条件 （可能宣布下修/没有宣布啥)
    # -1:代表还没开始下修计数 （确实没下修计数/处于暂不下修期）
    "readjust_dt": "重新下修的时间",
    "drdays": "距离重新下修的时间",
    # 正数:重下修时间还在后面呢
    # 负数:已经过了重下修时间了
    "adjust_date": " 下修时间(股东大会时间)",
    "margin_flg": "融资融券标的",
    "adjust_tc": "下修条款",
    "pb": "正股PB",
    "pb_flag": "股东权益含优先股和永续债,PB值与其他平台存在计算差异",
    "redeem_icon": "强赎图标",
    "bond_nm_tip": "转债名字旁边的提示",
    "adj_tips":"下修标记",# 一个S代表一次成功下修 一个F代表一次失败下修
    # S:下修成功 F:下修失败 R:正在等待下修开会 比如 SS 成功下修两次
    "unadj_tips": "不下修次数",
    "adjust_count": "下修计数",
    "adjust_event": "是否等着下修开会呢",
    "adjust_event_status": "下修开会状态",
    "adj_scnt": "下修成功次数",
    "adj_cnt": "提议下修次数",
    "after_next_put_dt": "是否处于回售期",  # 1是 0否
    "threshold_value":"下修触发价",
    "convert_cd_tip":"转股日期提示",
     "icons":"强赎状态",
    "convert_price_tips":"转股价下修情况历史",
    "adjust_condition":"下修条件",
    "adjust_event_valid_from":"下修价格生效日期",
    "adjust_event_meeting_dt":"股东大会日期",
    "adjust_event_convert_price":"新转股价",
    "adjust_event_dvdays":"下修过去几天了",
# {"R"，强赎} {“G”,不提前赎回} {'O'，公告强赎} B=以满足强赎条件 G =暂不强赎  空列表=条件不满足 M=条件不满足


}
pre_columns_map = {
    'price': "正股价",
    'increase_rt': "正股涨幅",
    'pma_rt': "正股现价比转股价",
    'margin_flg': "融资融券标的",
    'pb': "正股PB",
    'rid': "rid",
    'stock_id': "正股代码",
    'stock_nm': "正股名称",
    'bond_id': "转债代码",
    'bond_nm': "转债名称",
    'audit_id': "audit_id",
    'registration': "registration",
    'progress': "发债进展",  # 90 80 50 20 10
    'accept_date': "接受日期",
    'amount': "发行规模(亿元)",
    'b_shares': "b_shares",
    'pg_shares': "pg_shares",
    'cb_amount': "百元股票含权(元)",
    'ma20_price': "MA20价格",
    'naps': "naps",
    'convert_price': "转股价",
    'cb_flag': "cb_flag",
    'apply_date': "申购日",
    'apply_cd': " 申购代码",
    'ration_cd': "配债代码",
    'record_dt': "股权登记日",
    'record_price': "股权登记日股价",
    'ration': "每股配售(元)",
    'list_date': "上市时间",
    'list_price': "上市价格?",
    'status_cd': "",
    'ration_rt': "股东配售率",
    'online_amount': "网上规模(亿元)",
    'lucky_draw_rt': "中签率",
    'individual_limit': "",
    'underwriter_rt': "包销比例",
    'rating_cd': "评级",
    'offline_limit': "",
    'offline_accounts': "",
    'offline_draw': "",
    'valid_apply_raw': "",
    'jsl_advise_text': "",
    'apply10': "配售10张所需股数",
    'progress_nm': "进度名称",
    'cb_type': "类型(可转债)",
    'progress_dt': "进度日期",
    'progress_full': "???",
    'cp_flag': "发债标记",  # Y 已发 N未发
    'apply_tips': "申购配售tips",
    'ap_flag': "标记",  # E->待上市 B->待申购 A->申购日(打新日) C->已申购 N->未申购
    'single_draw': "",
    'valid_apply': "",
    'orders': "",

}

default_columns = ["行业", "转债代码", "转债名称", "正股名称", "评级","现价","溢价率","剩余年限","剩余规模","换手率","到期税前收益"]
pre_default_columns = ["正股代码", "正股名称", "转债名称", "进度名称", "发债进展",
                       "发行规模(亿元)", "正股价","每股配售(元)","百元股票含权(元)",
                       "股权登记日","申购日","配售10张所需股数","标记"]

pre_default_columns = ["stock_id", "stock_nm", "bond_nm", "progress_nm", "progress_dt", "progress",
                       "amount", "price","ration", "cb_amount",
                       "record_dt", "apply_date", "apply10", "ap_flag","big_stockholder",
                       'price_percent', 'stock_industry']

# alive_bond_values = list(alive_bond_map.values())
# print(alive_bond_values)